package com.only4play.httpapt.support.api.impl;

import com.only4play.httpapt.support.api.JpCommentService;
import com.only4play.httpapt.support.api.JpPostService;
import com.only4play.httpapt.support.api.JsonPlaceholderService;
import com.only4play.httpapt.support.config.JsonPlaceholderConfigStorage;

/**
 * @author liyuncong
 * @version 1.0
 * @file JsonPlaceholderServiceImpl
 * @brief JsonPlaceholderServiceImpl
 * @details JsonPlaceholderServiceImpl
 * @date 2024-08-16
 *
 * Edit History
 * ----------------------------------------------------------------------------
 * DATE                     NAME               DESCRIPTION
 * 2024-08-16               liyuncong          Created
 */
public class JsonPlaceholderServiceImpl
    extends SimpleHttpSupportApacheHttpClientImpl
    implements JsonPlaceholderService {

    private final JpPostService postService = new JpPostServiceImpl(this);
    private final JpCommentService commentService = new JpCommentServiceImpl(this);

    protected JsonPlaceholderConfigStorage configStorage;

    @Override
    public JsonPlaceholderConfigStorage getConfigStorage() {
        return this.configStorage;
    }

    @Override
    public void setConfigStorage(JsonPlaceholderConfigStorage configStorage) {
        this.configStorage = configStorage;
        initHttp();
    }

    @Override
    public JpPostService getPostService() {
        return postService;
    }

    @Override
    public JpCommentService getCommentService() {
        return commentService;
    }
}
